import {applyMiddleware, compose, createStore} from 'redux';
import thunk from 'redux-thunk';
import {persistStore} from 'redux-persist';

import reducer from './reducer';

const composeEnhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(reducer, composeEnhancer(applyMiddleware(thunk)));
export const persistor = persistStore(store); //  存入缓存的store
export default store; //  正常存储的store
